package com.buba.customer.service.Impl;

import com.buba.customer.dao.CustomerMapper;
import com.buba.customer.pojo.Customer;
import com.buba.customer.service.CustomerService;
import com.buba.system.pojo.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class CustomerServiceImpl implements CustomerService {
    private CustomerMapper customerMapper;

    /**
     * 查询所有客户
     * @param page
     * @return
     */
    @Override
    public List<Customer> selCustomerTable(Page<Customer> page) {
        return customerMapper.selCustomerTable(page);
    }

    /**
     * 查询客户总条数
     * @return
     */
    @Override
    public Long selCustomerCount() {
        return customerMapper.selCustomerCount();
    }

    /**
     * 删除
     * @param list
     * @return
     */
    @Override
    public Integer delCustomerAll(List<String> list) {
        return customerMapper.delCustomerAll(list);
    }

    /**
     * 添加
     * @param map
     * @return
     */
    @Override
    public Integer addCustomer(Map<String, Object> map) {
        return customerMapper.addCustomer(map);
    }

    /**
     * 携带条件查询条数
     * @param map
     * @return
     */
    @Override
    public Long selCount(Map<String, Object> map) {
        return customerMapper.selCount(map);
    }

    /**
     * 携带条件查询所有
     * @param map
     * @return
     */
    @Override
    public List<Customer> selAllCustomer(Map<String, Object> map) {
        return customerMapper.selAllCustomer(map);
    }

    @Override
    public Integer updCustomer(Map<String, Object> map) {
        return customerMapper.updCustomer(map);
    }



    @Override
    public List<Customer> selCustomerCustomerNo(Map<String, Object> map) {
        return customerMapper.selCustomerCustomerNo(map);
    }


    @Autowired
    public void setCustomerMapper(CustomerMapper customerMapper) {
        this.customerMapper = customerMapper;
    }
}
